Title: Year 12 / Computer Science / Practical / 10 - Data types and structures / 10.1 - Data types and Records

Q: Describe what is meant by an "integer" data type
A: a positive or negative number with no fractional part, stored in binary for processing and storage
some languages differentiate short/long integers

Q: Describe what is meant by a "real" data type
A: a number that contains a decimal point
referred to as a single or double depending on number of bytes used to store

Q: Describe what is meant by a "character" data type
A: a singular letter, number, punctuation or space that takes up a single unit of storage, usually 1 byte

Q: Describe what is meant by a "string" data type and its properties
A: combination of alphanumeric characters enclosed in " "
each character stored in 1 byte uses ascii code, each stored in 2 bytes uses unicode
max length of string is limited by available memory
cant store dates or numbers as strings
phone number must be stored as string, otherwise initial 0 is lost

Q: Describe what is meant by a "boolean" data type
A: can store only 1 of 2 values: true or false
stored in 1 byte: true = 11111111, false = 00000000

Q: Describe what is meant by a "date" data type
A: stored as a serial number
equates to number of seconds since 1st january 1970 00:00:00 utc
takes 8 bytes of storage
displayed as dd/mm/yy or mm/dd/yy

Q: Describe what is meant by a "array" data type
A: a data structure consisting of a collection of elements of the same data type
identified by at least 1 array index

Q: Describe what is meant by a "file" data type
A: object that stores data, information, settings or commands
can be opened, saved, deleted, moved
transferrable between network connections

Q: Describe what is meant by a "data type"
A: classification given to item of data, determines the type of value it can take and how it can be used

Q: Describe what is meant by a "data identifier"
A: unique name given to an item of data

Q: Describe what is meant by a "record"
A: a composite data type made of related items that can be different data types

Q: Describe what is meant by a "composite data type"
A: a data type made by using basic data types in a programming language

Q: Explain the purpose of the "record" data type
A: programmers can refer to related items within a record by using the same identifier

Q: Write the psuedocode to define a record structure and create a record
[[typebox:Back]]
A: TYPE <typename>
  DECLARE <identifier> : <data type>
  DECLARE <identifier> : <data type>
  ...
ENDTYPE
DECLARE <identifier> : <typename>

Q: Write the psuedocode to read data from a record structure and save data to it
[[typebox:Back]]
A: OUTPUT <record identifier>.<item identifier>
<record identifier>.<item identifier> <- <value>